package com.lap.tool.starter.autoconfigure;

import com.lap.tool.starter.holder.SpringHolder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * 写入下面文件: META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
 * com.lap.framework.spring.config.ServiceAutoConfiguration
 *
 * @author Shuisheng Lao(劳水生)
 * @version 0.0.1
 * @see SpringHolder
 */
@Slf4j
@AutoConfiguration
public class SpringAutoConfiguration {

  @Bean
  @ConditionalOnMissingBean(SpringHolder.class)
  SpringHolder createSpringSupport() {
    log.info("Initializer tool support");
    return new SpringHolder();
  }
}
